from pptx import Presentation
from pptx.util import Cm, Pt

from pptx.dml.color import RGBColor

prs = Presentation('trext.pptx')
# slide.shapes.add_picture(图片路径, 距离左边, 距离顶端, 宽度, 高度）
black_slide_layout = prs.slide_layouts[6]
slide = prs.slides.add_slide(black_slide_layout)
left = top = width = height = Cm(3)
# slide.shapes.add_picture(图片路径, 距离左边, 距离顶端, 宽度, 高度）
slide.shapes.add_picture("/Users/user/PycharmProjects/text1/matplotlib/one.png", left, top)


text_box = slide.shapes.add_textbox(left=Cm(0.5), top=Cm(-0.5), width=Cm(10), height=Cm(1.6))
tf = text_box.text_frame


p = tf.add_paragraph()
p.text = 'Shasta | Post_IT_FF'
p.font.blod = True
p.font.size = Pt(25)

p.font.name = "宋体"
p.font.color.rgb = RGBColor(41,36,33)

prs.save('trext.pptx')
